package org.pearl.account.controller;

import io.seata.core.context.RootContext;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j;
import org.pearl.account.dao.AccountTblMapper;
import org.pearl.account.entity.AccountTbl;
import org.pearl.account.feign.OrderClint;
import org.pearl.account.feign.StorageApi;
import org.pearl.account.service.AccountTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by TD on 2022/1/26
 */
@Slf4j
@RestController
@RequestMapping
public class TccController {

    @Autowired
    AccountTblService accountTblService;


    @GetMapping("/testTcc")
    @GlobalTransactional
    public Object test() {
        return  accountTblService.prepareBuy("11111111","iphone11",1L);
    }

}
